CC=g++
CFLAGS=
LIBS=-lSDL -lSDL_image -lSDL_ttf -lSDL_mixer
OBJ=game.o game_data.o sdlapp.o test.o sdlsurface.o textblock.o sdltimer.o sdlsound.o soundPlayer.o

sdlapp : $(OBJ)

test.o : test.cpp test.h sdlapp.h sdlsurface.h
	$(CC) $(CFLAGS) -c test.cpp $(LIBS)

sdltimer.o : sdltimer.cpp sdltimer.h
	$(CC) $(CFLAGS) -c sdltimer.cpp $(LIBS)

textblock.o : textblock.cpp textblock.h sdlapp.h sdlsurface.h
	$(CC) $(CFLAGS) -c textblock.cpp $(LIBS)

sdlsound.o : sdlsound.cpp sdlsound.h
	$(CC) $(CFLAGS) -c sdlsound.cpp $(LIBS)
	
soundPlayer.o : soundPlayer.cpp soundPlayer.h sdlsound.h
	$(CC) $(CFLAGS) -c soundPlayer.cpp $(LIBS)

sdlsurface.o : sdlsurface.cpp sdlsurface.h sdlapp.h
	$(CC) $(CFLAGS) -c sdlsurface.cpp $(LIBS)
	
game_data.o : game_data.cpp sdlsound.h
	$(CC) $(CFLAGS) -c game_data.cpp $(LIBS)

game.o : game.cpp sdlapp.h test.h sdltimer.h
	$(CC) $(CFLAGS) -c game.cpp $(LIBS)
	
sdlapp.o : sdlapp.cpp sdlapp.h
	$(CC) $(CFLAGS) -c sdlapp.cpp $(LIBS)

sdlapp : $(OBJ)
	$(CC) $(CFLAGS) -o sdlapp $(OBJ) $(LIBS)
clean:
	rm *.o
	rm *.gch
	rm sdlapp
